﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

public class OutCardConsole : MonoBehaviour,IPointerEnterHandler,IPointerUpHandler,IPointerDownHandler {
    public Action<GameObject, PointerEventData> onPointerEnter;
    public Action<GameObject, PointerEventData> onPointerUp;
    //public Action<GameObject, PointerEventData> onPointerClick;
    public Action<GameObject, PointerEventData> onPointerDown;
    public bool isSelected=false;
    void IPointerEnterHandler.OnPointerEnter(PointerEventData eventData)
    {
        onPointerEnter(gameObject, eventData);
    }

    void IPointerUpHandler.OnPointerUp(PointerEventData eventData)
    {
        onPointerUp(gameObject, eventData);
    }
    void IPointerDownHandler.OnPointerDown(PointerEventData eventData)
    {
        onPointerDown(gameObject, eventData);
    }
    public static OutCardConsole GetScript(GameObject go)
    {
        OutCardConsole script = null;
        if (go != null)
        {
            script = go.GetComponent<OutCardConsole>();
            if (script == null)
            {
                script = go.AddComponent<OutCardConsole>();
            }
        }
        return script;
    }
    public void ChangeColor(Color color)
    {
        gameObject.GetComponent<Image>().color = color;
    }
   


}
